#ifndef KLOTSKI_H
#define KLOTSKI_H

#include <QMainWindow>
#include<QPushButton>
#include<QSound>




QT_BEGIN_NAMESPACE
namespace Ui { class Klotski; }
QT_END_NAMESPACE

class Klotski : public QMainWindow

{
    Q_OBJECT

public:
    Klotski(QWidget *parent = nullptr);
    ~Klotski();
    void paintEvent(QPaintEvent *event);
    void Init();
    void Initcc();
    void Initzf();
    void Initgy();
    void Initmc();
    void Initzy();
    void Inithz();
    void Initb();
    void keyPressEvent(QKeyEvent *event);

public slots:
    void k_update();
    void restart();
    void openSound();
    void closeSound();

signals:


private:
    Ui::Klotski *ui;
    QRect Cc;
    QRect Zf;
    QRect Gy;
    QRect Mc;
    QRect Zy;
    QRect Hz;
    QRect B1;
    QRect B2;
    QRect B3;
    QRect B4;
    QRect leftb;
    QRect rightb1;
    QRect rightb2;
    QRect topb;
    QRect bottomb;
    QRect b;
    QRect win;
    int Direction;
    int role;
    int steps;
    bool isrun;
    bool iswin;
    bool isSound;
    QTimer *timer;
};

#endif // KLOTSKI_H
